﻿<UserControl x:Class="BTM_Client_Application.RealTimeFilter.DateTimeFilterElementControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:xceedtk="http://schemas.xceed.com/wpf/xaml/toolkit"
             mc:Ignorable="d" 
             d:DesignHeight="100" d:DesignWidth="200">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
                <!--<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />-->
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
                <ResourceDictionary Source="pack://application:,,,/Styles/UserControls.xaml" />
                <ResourceDictionary Source="pack://application:,,,/Styles/MyResources.xaml" />
                <ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyles.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <Border CornerRadius="5" Padding="4" Background="White" BorderThickness="2">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <!--<Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Border Grid.Row="0" Grid.ColumnSpan="2" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource AccentColorBrush}">
                <Grid Grid.Row="0" Grid.ColumnSpan="2">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Label Name="StartTimeLabel" Content="Start time" VerticalAlignment="Center" Grid.Column="0" Grid.Row="0"></Label>
                    <Label Name="EndTimeLabel" Content="End time" VerticalAlignment="Center" Grid.Row="0" Grid.Column="1"/>
                    <Border Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Right" Background="{DynamicResource AccentColorBrush}">
                        <Button Name="CloseButton" Width="20" Height="20" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" 
                        Style="{StaticResource ToolBarButton}" Click="CloseButton_OnClick" Grid.Column="1">
                            <Image Source="{StaticResource ResourceKey=CloseImageDark}"/>
                        </Button>
                    </Border>
                </Grid>
            </Border>

            <Border Name="StartTimeBorder" Grid.Column="0" Grid.Row="1" Margin="0,0,0,0">
                <xceedtk:DateTimePicker Name="StartTimePicker" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0,5,5,0" ValueChanged="StartTimePicker_OnValueChanged"/>
            </Border>

            <Border Name="EndTimeBorder" Grid.Column="1" Grid.Row="1" BorderThickness="1,0,0,0"  BorderBrush="{DynamicResource AccentColorBrush}" SnapsToDevicePixels="True">
                    <xceedtk:DateTimePicker Margin="5,5,0,0" Name="EndTimePicker" HorizontalAlignment="Stretch" VerticalAlignment="Top" ValueChanged="EndTimePicker_OnValueChanged"/>
            </Border>-->
            <Grid Name="StartTimeGrid" Grid.Column="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Border BorderThickness="0,0,0,1" BorderBrush="{DynamicResource AccentColorBrush}">
                    <Label Name="StartTimeLabel" Content="Start time"/>
                </Border>
                <xceedtk:DateTimePicker Name="StartTimePicker" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0,5,5,0" ValueChanged="StartTimePicker_OnValueChanged"/>

            </Grid>

            <Grid Name="EndTimeGrid" Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Border BorderThickness="0,0,0,1" BorderBrush="{DynamicResource AccentColorBrush}">
                    <Label Name="EndTimeLabel" Content="End time"></Label>
                </Border>
                <xceedtk:DateTimePicker Margin="5,5,0,0" Name="EndTimePicker" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Top" ValueChanged="EndTimePicker_OnValueChanged"/>
            </Grid>

            <Border Grid.ColumnSpan="2" VerticalAlignment="Top" HorizontalAlignment="Right" Background="{DynamicResource AccentColorBrush}">
                <Button Name="CloseButton" Width="20" Height="20" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" 
                        Style="{StaticResource ToolBarButton}" Click="CloseButton_OnClick" Grid.Column="1">
                    <Image Source="{StaticResource ResourceKey=CloseImageDark}"/>
                </Button>
            </Border>


        </Grid>
    </Border>
</UserControl>
